<script setup lang="ts">
import { storeToRefs } from "pinia";
import { Lock } from "@element-plus/icons-vue";
import { reactive, watch } from "vue-demi";
import { useRankStore } from "@/stores/Rank";
const rankStore = useRankStore();

// let user = Game.user;
// 表格
const { rank, rankSoloData, rankSrDate, rankTftDate, honor } =
  storeToRefs(rankStore);

//
</script>
<template>
  <div class="content">
    <!-- 单双 -->
    <div class="row">
      <div class="col"><div class="item">单双排位</div></div>

      <div v-if="rankSoloData.isRun" class="col" style="white-space: pre-wrap">
        <div class="item">
          {{
           
            rankSoloData.tier +
            "\n" +
            "赢 " +
            rank.rankSolo.wins +
            " 输 " +
            rank.rankSolo.losses +
            "\n" +
            " 胜率 " +
            rankSoloData.winRate +
            "%"
          }}
        </div>
      </div>

      <div
        v-if="!rankSoloData.isRun"
        class="col"
        style="white-space: pre-wrap"
      >
        <div class="iem">
          {{ "未进行游戏" }}
        </div>
      </div>
    </div>
    <!-- 灵活 -->
    <div class="row">
      <div class="col"><div class="item">灵活组排</div></div>

      <div v-if="rankSrDate.isRun" class="col" style="white-space: pre-wrap">
        <div class="item">
          {{
          
            rankSrDate.tier +
            "\n" +
            "赢 " +
            rank.rankSr.wins +
            " 输 " +
            rank.rankSr.losses +
            "\n" +
            " 胜率 " +
            rankSrDate.winRate +
            "%"
          }}
        </div>
      </div>

      <div v-if="!rankSrDate.isRun" class="col" style="white-space: pre-wrap">
        <div class="item">{{ "未进行游戏" }}</div>
      </div>
    </div>
    <!-- 云顶 -->
    <div class="row">
      <div class="col"><div class="item">云顶之弈</div></div>

      <div v-if="rankTftDate.isRun" class="col" style="white-space: pre-wrap">
        <div class="item">
          {{
           
            rankTftDate.tier +
            "\n" +
            "赢 " +
            rank.rankTft.wins +
            " 输 " +
            rank.rankTft.losses +
            "\n" +
            " 胜率 " +
            rankTftDate.winRate +
            "%"
          }}
        </div>
      </div>

      <div v-if="!rankTftDate.isRun" class="col" style="white-space: pre-wrap">
        <div class="item">{{ "未进行游戏" }}</div>
      </div>
    </div>
    <!-- 荣誉等级 -->
    <div class="row">
      <div class="col">
        <div class="item">荣誉等级 {{ honor.honorLevel }}</div>
      </div>

      <div class="col">
        <div class="item">
          {{ honor.rewardsLocked ? "荣誉已被锁定" : "荣誉良好" }} 里程碑点数
          {{ honor.checkpoint }}
        </div>
      </div>
    </div>
  </div>
</template>
<style lang="less" scoped>
//
.content {
  font-size: 15px;
  display: flex;
  flex-direction: column;
  height: 100%;
  .row {
    display: flex;
    // justify-content: space-between;
    justify-content: space-between;
    margin-bottom: 10px;
    height: 50%;

    .col {
      // bacc
      // widows: 30%;
      width: 26%;
      height: 100%;
      text-align: center;
      // border-radius: 20px;
  

      .item {
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        // margin: 1px;
        padding: 3px;
        border: 1px solid white;
        // border-radius: 20px;

        line-height: 150%;
      }
    }
    .wins {
      width: 32%;
    }

    & > .col:nth-child(1) {
      // background-color: red;
      // background: linear-gradient(135deg,#f54ea2,#ff7676);
      background: linear-gradient(135deg,#abdcff,#0396ff);
      // flex-grow: .;
      box-shadow: var(--el-box-shadow);
      padding: 5px;
    }

    & > .col:nth-child(2) {
      // flex: 2;
      flex-basis: 220px;
      // background-color: red;
      background: linear-gradient(135deg,#ffa8a8,#fcff00);

      // background: #fd8572;
      box-shadow: var(--el-box-shadow);
      padding: 5px;
    }
  }
}

// .prompt {
//   width: 32%;
//   border: 3px solid #fbe050;
//   padding: 5px;
// }
</style>
